package com.wk.springBootDemo.controller;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.wk.springBootDemo.service.TestService;
@Controller
public class TestController {

	//@Autowired
	//@Qualifier("testService2")
	//@Resource(name="testService2")
	@Resource(type=TestService.class)
	private TestService testService;
	
	@RequestMapping("/test/a.do")
	@ResponseBody
	public String a(){
		return "a";
	}
	
	@RequestMapping("/test/testPrint.do")
	@ResponseBody
	public String testPrint(){
		testService.testPrint();
		return "testPrint";
	}
	
	@RequestMapping("/")
	@ResponseBody
	String home() {
		return "Hello World!";
	}
	
	@RequestMapping("/test/dev.do")
	@ResponseBody
	public String dev(){
		testService.testPrint();//this is printing
		System.out.println("-------add something");
		return "dev";
	}

}
